<script setup>
import {ref} from 'vue'
let x = 1
console.info(x)
let text1 = '哈哈哈哈哈哈'
let text = '<span style="color: red">哈哈哈哈哈</span>'
let time = ref(new Date())
let grade = 88
let name = ''
let pid = 'text'
let arr = ref([1,2,3,4])
let students = [
    {name:'小李',sn:'2413',age:'19'},
    {name:'小王',sn:'2412',age:'19'},
    {name:'小张',sn:'2411',age:'19'},
    {name:'小天',sn:'2410',age:'19'},
    {name:'小齐',sn:'2419',age:'19'}
]
/*
window.onload = function (){
  document.getElementById("button").onclick = ()=>
  {
    let text2 = document.getElementsByName("name")[0]
    console.info(text2.value)
  }
}
*/
import {useRouter} from "vue-router";
const router = useRouter()

let inputValue = ref("哈哈哈")
const btnEvent = ()=>{
  console.info(inputValue.value)
//   输出字符串1111 需要加引号   输出数字1111 不用加引号
}
setInterval(()=>{
   time.value = new Date()
  //现在time是个对象，要是给time赋值，应该是给time.value赋值
},1000)
let addValue = ()=>{
  arr.value.push(inputValue.value)
}
const toDemo = ()=>{
  router.push({path:'/demo'})
}
const toHello=()=>{
  router.push({path:'/hello'})
}
</script>

<template>
<div id="d0">
  <div id="d2">
    <RouterLink to="/demo">去demo</RouterLink>
    <br>
    <RouterLink to="/hello">去hello</RouterLink>
    <br>
    <button @click="toDemo">去demo</button>
    <el-button type="primary">去demo</el-button>
    <br>
    <button @click="toHello">去hello</button>
  </div>
  <div id="d3">
    <RouterView/>
    <!--  // 相对于 div 所有demo的内容-->
  </div>

</div>
</template>

<style scoped>
#d0{
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;

}

#d2{
  width: 100px;
  height: 100%;
  background-color: bisque;

}
#d3{
  width: 600px;
  height: 100%;
  background-color: lightblue;
  font-family: 楷体;
  font-size: 20px;

}
</style>
<!--Myth修改了代码-->
<!--组长写代码-->
<!--koi写代码-->
<!--你好，哈哈哈哈哈-->
<!--welcome to happy world！-->
<!--添加myth的修改-->